package com.mz.ozy.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mz.ozy.R;
import com.mz.ozy.bean.MallBean;
import com.mz.ozy.bean.MallCategoryBean;
import com.mz.ozy.utils.Utils;
import com.mz.ozy.utils.glideUtils.GlideUtils;

import java.util.List;

/**
 * Created by administrator on 2018/11/21.
 */
public class SaveDayAdapter extends BaseQuickAdapter<MallBean.CateListBean, BaseViewHolder> {

    public SaveDayAdapter(@Nullable List<MallBean.CateListBean> data) {
        super(R.layout.item_assets_unit_select, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MallBean.CateListBean item) {
        helper.setText(R.id.tv_goods_name, String.valueOf(item.getName()));
        final ImageView view = helper.getView(R.id.iv_goods_pic);
        GlideUtils.loadRoundImg(mContext, view, item.getImg(), R.mipmap.default_foods_icon, 4);
        if (helper.getAdapterPosition() / 3 == 0) {
            helper.getConvertView().setPadding(0, Utils.dp2px(mContext, 25), 0, 0);
        } else {
            helper.getConvertView().setPadding(0, Utils.dp2px(mContext, 15), 0, 0);
        }
    }
}
